USE [RedemptoristRetreat]
GO

IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Retreat_RetreatCategory]') AND parent_object_id = OBJECT_ID(N'[dbo].[Retreat]'))
ALTER TABLE [dbo].[Retreat] DROP CONSTRAINT [FK_Retreat_RetreatCategory]
GO

USE [RedemptoristRetreat]
GO

/****** Object:  Table [dbo].[Retreat]    Script Date: 12/01/2013 14:29:02 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Retreat]') AND type in (N'U'))
DROP TABLE [dbo].[Retreat]
GO

USE [RedemptoristRetreat]
GO

/****** Object:  Table [dbo].[Retreat]    Script Date: 12/01/2013 14:29:02 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Retreat](
	[retreatId] [int] IDENTITY(1,1) NOT NULL,
	[title] [varchar](50) NULL,
	[description] [varchar](1000) NULL,
	[duration] [float] NULL,
	[fee] [float] NULL,
	[activeData] [tinyint] NULL,
	[modifiedBy] [varchar](25) NULL,
	[modifiedTimestamp] [datetime] NULL,
	[categoryId] [int] NULL,
 CONSTRAINT [PK_Retreat] PRIMARY KEY CLUSTERED 
(
	[retreatId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Retreat]  WITH CHECK ADD  CONSTRAINT [FK_Retreat_RetreatCategory] FOREIGN KEY([categoryId])
REFERENCES [dbo].[RetreatCategory] ([categoryId])
GO

ALTER TABLE [dbo].[Retreat] CHECK CONSTRAINT [FK_Retreat_RetreatCategory]
GO

